<%@ include file="/common/taglibs.jsp"%>

<%
if(request.getParameter("from") == null) {
%>
<head>
    <title><fmt:message key="meetingRoomList.title"/></title>
    <meta name="heading" content="<fmt:message key='meetingRoomList.heading'/>"/>
</head>
<div id="search">
<form method="get" action="${ctx}/meetingRoom!list" id="searchForm">
    <input type="text" size="20" name="q" id="query" value="${param.q}"
           placeholder="Enter search terms..."/>
    <input type="submit" value="<fmt:message key="button.search"/>"/>
</form>
</div>
<display:table name="meetingRooms" cellspacing="0" cellpadding="0" requestURI="" 
    defaultsort="1" id="meetingRooms" pagesize="25" class="table" export="false">
    <display:column property="name" escapeXml="true" sortable="true" titleKey="meetingRoom.name" style="width: 25%"
        url="/bookMeetingRoom!list?from=meetingRoomList" paramId="meetingRoomId" paramProperty="id"/>
    <display:column property="location" titleKey="meetingRoom.location" style="width: 34%"/>
    <display:column property="description" titleKey="meetingRoom.description" style="width: 25%"/>
    <display:column property="telephone" titleKey="meetingRoom.telephone" style="width: 25%"/>
    <display:column sortProperty="id" sortable="true" style="width: 16%; padding-left: 15px">
    </display:column>
</display:table>
<%} else if("meetingRoomList".equals(request.getParameter("from"))) {%>
<head>
    <title><fmt:message key="bookMeetingRoomList.title"/></title>
    <meta name="heading" content="<fmt:message key='bookMeetingRoomList.heading'/>"/>
</head>
<input type="button" style="margin-right: 5px"
    onclick="location.href='<c:url value="/bookMeetingRoom!edit?method=Add&from=list&meetingRoomId=${param.meetingRoomId}"/>'"
    value="<fmt:message key="button.add"/>"/>
<display:table name="bookMeetingRooms" cellspacing="0" cellpadding="0" requestURI="" 
    defaultsort="1" id="bookMeetingRooms" pagesize="25" class="table" export="false">
    <display:column property="description" titleKey="bookMeetingRoom.description" style="width: 25%"/>
    <display:column property="startTime" titleKey="bookMeetingRoom.startTime" style="width: 35%" format="{0,date,yyyy-MM-dd HH:mm}"/>
    <display:column property="endTime" titleKey="bookMeetingRoom.endTime" style="width: 35%" format="{0,date,yyyy-MM-dd HH:mm}"/>
    <display:column sortProperty="id" sortable="true" style="width: 16%; padding-left: 15px">
    </display:column>
</display:table>

<input type="button" style="margin-right: 5px"
    onclick="location.href='<c:url value="/bookMeetingRoom!edit?method=Add&from=list&meetingRoomId=${param.meetingRoomId}"/>'"
    value="<fmt:message key="button.add"/>"/>
<%
}
%>

<script type="text/javascript">
    highlightTableRows("bookMeetingRooms");
</script>
